﻿/*
Copyright (c) Microsoft Corporation

All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.  You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0   

THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.  

See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. 
*/

//-------------------------------------------------- //
/*
Mountain.js - 
Handles initializes and the drawing of the Mountain background
*/
//---------------------------------------------------//

(function (window) {
    "use strict";
    var Mountain = function () {
        //constructor
        this.init = function () {
            game.Entity.init.apply(this, null);
            this.type = 'mountain';

            this.framesize = { x: 768, y: 1366 };
            this.image = null;

            if (GLOBAL_HDASSETS === true) {
                this.image = game.Entity.loadimg('media/HD/gamemountain_hires.png');
                this.frames[0] = new game.Frame(0, 0, 1440, 2560);
                this.framesize = { x: 1440, y: 2560 };
                this.scale = 768 / 1440;
            }
            else {
                this.image = game.Entity.loadimg('media/gamemountain_lores.png');
                this.frames[0] = new game.Frame(0, 0, 768, 1366);
                this.framesize = { x: 768, y: 1366 };
            }


            this.pos = { x: 0, y: 0 };

        };

        this.init();

        this.update = function () {

        };

        this.draw = function () {
            if (this.image.complete === true) {
                    game.Entity.draw.apply(this, null); //draw using entity base
            }
        };
    };
    game.Mountain = Mountain; //Assign Object to Game Namespace
})(window);

